# coding:utf-8
from __future__ import absolute_import
import argparse
import os
from src.data import OriginData
import logging


def parse_args():
    parser = argparse.ArgumentParser()
    parser.add_argument('-o', '--origin-dir', default='data/china')
    parser.add_argument('-t', '--target-dir', default='tensorflow_data/')
    parser.add_argument('-n', '--train-num', default=900, type=int)
    parser.add_argument('-f', '--train-factor', default=0.8, type=float)

    return parser.parse_args()


select_class_list = [
    # 'usa_landuse_cemetery',
    # 'usa_landuse_commercial',
    # 'usa_landuse_farm',
    # 'usa_landuse_farmland',
    # 'usa_landuse_forest',
    # 'usa_landuse_garages',
    # 'usa_landuse_greenhouse_horticulture',
    # 'usa_landuse_meadow',
    # 'usa_landuse_orchard',
    # 'usa_landuse_quarry',
    # 'usa_landuse_railway',
    # 'usa_landuse_retail',
    # 'usa_landuse_vineyard',



    # 'usa_building_apartments',
    # 'small_usa_building_house',
    # 'small_usa_building_residential',
    # 'usa_building_commercial',
    # 'usa_building_greenhouse',


    # 'usa_natural_bare_rock',
    # 'small_usa_natural_wetland',
    # 'small_usa_natural_wood',
    # 'usa_natural_beach',
    # 'usa_natural_glacier',
    # 'small_usa_natural_water',
    'china_building_commercial',
    'china_building_industrial',
    'china_east_building_residential',
    'china_east_landuse_farmland',
    'china_jzh_natural_wood',
    'china_jzh_natural_water',


]


if __name__ == '__main__':
    logging.basicConfig(level=logging.INFO)
    args = parse_args()
    origin_data = OriginData(args.origin_dir, select_class_list, args.train_num)
    origin_data.create_split_dir(args.target_dir, args.train_factor)
